<?php

$region = new Region();

if ($region->load_by_slug($definition[0],true)) {

	function the_title() {
		global $region;
		echo utf8_encode($region->title);
	}
	function the_content() {
		global $region;
		echo utf8_encode($region->get_content());
	}
		
	function the_region_json() {
		global $region;
?>
			idRegion: '<?php echo $region->get_id(); ?>',
			title: '<?php echo utf8_encode($region->get_title()); ?>',
			slug: '<?php echo $region->slug; ?>',
			content: '<?php echo utf8_encode($region->get_content()); ?>',
			idParent: '<?php echo $region->id_parent; ?>',
			creationTime: '<?php echo $region->creation_time; ?>',
			type: '<?php echo $region->type; ?>'
<?php
	}
	
} else {

	function the_title() {
		global $site;
		echo $site->lang("Not Found");
	}
	function the_content() {
		global $region;
		echo $region->_errmsg;
	}
		
	$cur_section = "404";
	
}

?>